import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home'
import classify from '../views/classify'
import myself from '../views/myself'
import shopcar from '../views/shopCar'
import news from '../views/news'
import order from '../views/shopCar/order'
import login from '../views/login'
import register from '../views/register'
import close from '../views/myself/close'
import adress from '../views/shopCar/order/adress'
import le6ji from '../views/Home/le6ji'
import teSeGuan from '../views/Home/teSeGuan'
import leXianYu from '../views/Home/leXianYu'
import dianS from '../views/Home/dianS'
import nt from '../views/Home/nt'
import rw from '../views/Home/rw'
import ly from '../views/Home/ly'
import address from '../views/address'
import city from '../views/city'
import china from '../views/Home/teseguan/china'
import search from '../views/Home/Search'
import myorder from '../views/myself/myorder'
import jidan from '../views/myself/jidan'
import word from '../views/myself/word'
import redPaper from '../views/myself/redPaper'
// import news from '../views/news'

Vue.use(VueRouter)

const routes = [
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    component: Home
  },
  {
    path: '/classify ',
    path: '/home/le6ji',
    component: le6ji
  },
  {
    path: '/home/teSeGuan',
    component: teSeGuan,
    children: [
      {
        path: '/home/teSeGuan',
        redirect: '/home/teSeGuan/nt/2'
      },
      {
        path: '/home/teSeGuan/nt/:id',
        component: nt
      },
      {
        path: '/home/teSeGuan/rw/:id',
        component: rw
      },
      {
        path: '/home/teSeGuan/ly/:id',
        component: ly
      }
    ]
  },
  {
    path: '/home/teSeGuan/china',
    component: china
  },
  {
    path: '/home/leXianYu',
    component: leXianYu
  },
  {
    path: '/home/dianS',
    component: dianS
  },
  {
    path: '/classify',
    component: classify
  },
  {
    path: '/myself',
    component: myself
  },
  {
    path: '/myself/close',
    component: close
  },
  {
    path: '/shopcar',
    component: shopcar
  },
  {
    path: '/shopCar/order',
    component: order
  },
  {
    path: '/shopCar/order/adress',
    component: adress
    
  },
  {
    path:'/myself/myorder',
    component:myorder
  },
  {
    path:'/myself/jidan',
    component:jidan
  },
  {
    path:'/myself/word',
    component:word
  },
  {
    path:'/myself/redPaper',
    component:redPaper
  },
  {
    path: '/shopcar',
    component: shopcar
  },
  {
    path: '/news',
    component: news
  },
  {
    path: '/login',
    component: login
  },
  {
    path: '/register',
    component: register
    
  },
  {
    path: '/address',
    component: address
  },
  {
    path: '/address/city/:id',
    component: city
  },
  {
    path: '/search',
    component: search
  },
  // {
  //   path: '/news',
  //   component: news
  // },
  {
    path: '/classify/foodlist/:gc_id',
    component: ()=>import('@/views/foodList')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
